package org.qiancizhan.Config;

import org.qiancizhan.Utils.ConfigUtil;
import redis.clients.jedis.Jedis;

public class RedisConfig {
    private static Jedis redis = null;

    public RedisConfig() {
        if (redis == null) redis = new Jedis(ConfigUtil.get("redis.host"), ConfigUtil.getInt("redis.port", 6379));
    }

    public static Jedis getInstance() {
        return redis;
    }


    public void close() {
        redis.close();
    }
}